package com.hohd.interest;

import cn.sharesdk.framework.authorize.e;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.GestureDetector;
import android.view.GestureDetector.OnGestureListener;
import android.view.MotionEvent;

public class SplashActivity extends Activity implements OnGestureListener {
	GestureDetector detector = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_splash);
		detector = new GestureDetector(this);
	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {

		return detector.onTouchEvent(event);
	}

	@Override
	public boolean onDown(MotionEvent e) {
		return false;
	}

	@Override
	public void onShowPress(MotionEvent e) {

	}

	@Override
	public boolean onSingleTapUp(MotionEvent e) {
		return false;
	}

	@Override
	public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
		Log.i("print", "onFling");
		return false;
	}

	@Override
	public void onLongPress(MotionEvent e) {

	}

	@Override
	public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
		// 快速滑动
		float start = e1.getX();
		float end = e2.getX();
		if (end < start){
			Intent intent=new Intent(this,MainActivity.class);
			startActivity(intent);
			finish();
		}
		return false;
	}

}
